#include<stdio.h>
int main(void){
    int a[20] = {1,1};
    for(int i=2;i<20;i++){
        a[i] = 3*a[i-2] + a[i-1];
    }
    printf("%d",a[20]);
    return 0;
}